<!--网站主页（带 ECharts）-->
<script setup>
import { onMounted } from 'vue';
import * as echarts from 'echarts';

onMounted(() => {
  const chartDom = document.getElementById('echarts-table');
  if (!chartDom) return;
  const myChart = echarts.init(chartDom);
  const option = {
    title: { text: '用户访问统计', left: 'center', textStyle: { color: '#1e3a8a' } },
    tooltip: {},
    xAxis: {
      type: 'category',
      data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
    },
    yAxis: { type: 'value' },
    series: [
      {
        name: '访问量',
        type: 'bar',
        data: [120, 200, 150, 80, 70, 110, 130],
        itemStyle: { color: '#409eff' },
      },
    ],
  };
  myChart.setOption(option);
});
</script>

<template>
  <div>
    <div id="echarts-table" style="width: 100%; height: 400px;"></div>
  </div>
</template>

<style scoped>
/* 样式可根据需要调整 */
</style>
